<?php 
$cs=Yii::app()->clientScript;
$cs->registerCssFile(Yii::app()->baseUrl.'/css/form.css');
?>
<h2><?php echo $update==true?'添加文档':'修改文档';?></h2>
<?php if(!$update):?>
<div class="actionBar">
[<?php echo CHtml::link('返回',array('news_admin')+$_GET); ?>]
</div>
<?php endif;?>
<div class="yiiForm">
<?php
	echo EHtml::form();	
	EHtml::setOptions(array('errorElement'=> 'span',));		
	EHtml::setScenario($update?'':'create');
?>
<div>注：<span class="required">*</span>为必填项</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'kind'); ?>
<?php echo EHtml::activeDropDownList($model,'kind',$model->getKindNames(),array('width'=>10));?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'title'); ?>
<?php echo EHtml::activeTextField($model,'title',array('size'=>50,'maxlength'=>50)); ?>
</div>
<div class="simple4">
<?php echo EHtml::activeLabelEx($model,'context'); ?>(最多上传2张图片,每张小于200K.)
<?php
$this->widget('application.extensions.xheditor.JXHEditor', array(
      'model' => $model,
      'attribute' => 'context',
      'options' => array(
          'width' => '700',
          'height' => '400',
		  'upImgUrl' =>'?r=admin/uploadedFiles&immediate=1',
		  'upImgExt' =>'jpg,jpeg,gif,png',
		  'img_sum' => 2,//最多2张图片
      ),
  ));
?>
</div>
<div class="action">
<?php echo EHtml::submitButton($update ? '添加文章':'修改文章'); ?>
</div>

<?php echo EHtml::endForm(); ?>
<?php if(!$update):?>
<div class="actionBar">
[<?php echo CHtml::link('返回',array('news_admin')+$_GET); ?>]
</div>
<?php endif;?>
</div><!-- yiiForm -->